package com.fjnldx.mes.domain.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.thymeleaf.util.StringUtils;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class SchedulingLaborCapital extends Model<SchedulingLaborCapital> {

    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(name = "id", value = "")
    private Integer id;

    @ApiModelProperty(name = "gongxu", value = "")
    private String gongxu;

    @ApiModelProperty(name = "workType", value = "")
    private String workType;

    @ApiModelProperty(name = "pz", value = "")
    private String pz;

    @ApiModelProperty(name = "lzxs", value = "")
    private String lzxs;


    public String saveCheck() {
        StringBuilder sb = new StringBuilder();
        if (StringUtils.isEmpty(this.getGongxu())) {
            sb.append("  工序不能为空");
        }
        if (StringUtils.isEmpty(this.getWorkType())) {
            sb.append("  工种不能为空");
        }
        if (StringUtils.isEmpty(this.getPz())) {
            sb.append("  品种不能为空");
        }
        if (StringUtils.isEmpty(this.getPz())) {
            sb.append("  劳资系数不能为空");
        }
        return sb.toString();
    }

    public String updateCheck() {
        StringBuilder sb = new StringBuilder();
        if (null == this.getId()) {
            sb.append("  id不能为空");
        }
        if (StringUtils.isEmpty(this.getGongxu())) {
            sb.append("  工序不能为空");
        }
        if (StringUtils.isEmpty(this.getWorkType())) {
            sb.append("  工种不能为空");
        }
        if (StringUtils.isEmpty(this.getPz())) {
            sb.append("  品种不能为空");
        }
        if (StringUtils.isEmpty(this.getPz())) {
            sb.append("  劳资系数不能为空");
        }
        return sb.toString();
    }
}
